/*--------------------------+
|	   Minigame Class		|
|	---------------------	|
|	Runs the Audiosurf-y	|
|	Minigame to unlock		|
|	bonus loot rooms		|
+--------------------------*/

#pragma once

#include "igamestate.h"
#include "Entity.h"
#include <vector>
using namespace std;

// Laziness
#define uint unsigned int

// Forward Declaration
class Emitter;

class MinigameState : public IGameState
{
public:

	// Get access to the singleton
	static MinigameState* GetInstance();

	// Initialization
	virtual void Enter(void);

	// Run the game
	void StartGame(int num);

	// Main Loop
	virtual bool Input(void);
	virtual void Update(float elapsedTime);
	virtual void Render(void);

	// Shutdown
	virtual void Exit(void);

	// Difficulty level
	enum Difficulty {EASY, MEDIUM, HARD};

	bool Failed;	// Whether or not the game was lost
	bool Won;		// If the game was won

private:

	// Constructor
	MinigameState(void);

	// The trilogy of stuff I don't have to write
	MinigameState(const MinigameState& other);
	MinigameState& operator=(const MinigameState& other);
	~MinigameState(void);

	/* Game-related variables */
	float TimeRemaining;		// Time left to survive
	float ObstacleTimer;		// Time before a new obstacle can spawn
	uint LivesRemaining;		// How many hits before the game is failed
	Entity PlayerShip;			// The players "Ship"
	vector<Entity*> Obstacles;	// The obstacles to dodge
	vector<Emitter*> BadTrails; // Enemy ship trails
	Difficulty CurDifficulty;	// The current difficulty
	int Background;				// The id for the background image
	int Ships;					// The id for the spaceships
	Emitter* Trail;				// The ship's trail
	float BackgroundY;			// The location of the background for scrolling
	int FailSound;				// Sound to play upon losing a life
	int playerNum;				// Which player is playing the game

};